//var price="";
//for (var i = 0; i < 5; i++) {
//	setTimeout()
//}
//chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
//	if (message == 'ok') { // sendResponse('Hello from background.');
//		//接收到ok命令
//		console.log("发送" + "ok" + "成功!");
//		//持续点击一键购买
//		setInterval(function(){$("#btn-onkeybuy")[0].click();},100);
//	}
//});
chrome.extension.onMessage.addListener(
        function(request, sender, sendResponse) {  
            if (request.msg == "ok") {  
            	//接收到ok命令
        		console.log("接受" + "ok" + "成功!");
        		//持续点击一键购买
        		var mysInter = setInterval(function(){$("#btn-onkeybuy")[0].click();},100);
        		setTimeout(function(){
        			clearInterval(mysInter);
        			$("#btn-onkeybuy")[0].click();
        			},2000);
            }  
            else  
                sendResponse({result: "不告诉你"})  
        });  

if(location.pathname=="/shopping/order/getEasyOrderInfo.action"){
	//持续点击提交订单
	var mysInter1 = setInterval(function(){$("#order-submit")[0].click();},100);
	setTimeout(function(){
		clearInterval(mysInter1);
		$("#btn-onkeybuy")[0].click();
		},2000);
	
}

